package com.knowvoyage.knowvoyageserver.pojo.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "学习记录类，后端给前端返回的类")
@Data
public class Learn {
    private Long learnId;

    @NotNull(message = "用户ID不能为空")
    @Positive(message = "用户ID必须为正数")
    private Long userId;

    @NotNull(message = "开始时间不能为空")
    @PastOrPresent(message = "开始时间不能是未来时间")
    private LocalDateTime startTime;

    @NotNull(message = "持续时间不能为空")
    @Min(value = 1, message = "持续时间至少1分钟")
    @Max(value = 1440, message = "持续时间最多1440分钟(24小时)")
    private Integer duration;

    private Long subject;
}
